<?php

require 'vendor/autoload.php';

$generator = new Picqer\Barcode\BarcodeGeneratorPNG();
try {
    $data = $generator->getBarcode('1321101237312', $generator::TYPE_CODE_128);
    file_put_contents('a.png', $data);
} catch (\Picqer\Barcode\Exceptions\BarcodeException $e) {
}